package openGL;


import javax.media.opengl.*;

import processing.core.PApplet;
import processing.opengl.*;

public class SimpleExample extends PApplet{

		
	float a; 
		
	public void setup() {
	  size(800, 600, OPENGL);
	}
		
	public void draw() {
	  background(255);
	  
	  PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;  // g may change
	  GL gl = pgl.beginGL();  // always use the GL object returned by beginGL
	  
	  // Do some things with gl.xxx functions here.
	  // For example, the program above is translated into:
	  gl.glColor4f(0.7f, 0.7f, 0.7f, 0.8f);
	  gl.glTranslatef(width/2, height/2, 0);
//	  gl.glRotatef(a, 1, 0, 0);
	  gl.glRotatef(a*2, 0, 1, 0);
	  gl.glRectf(-200, -200, 200, 200);
//	  gl.glRotatef(90, 1, 0, 0);
//	  gl.glRectf(-200, -200, 200, 200);
	  
	  pgl.endGL();
		  
	  a += 0.5;
	}

}
